/**
 * Selling Partner API for FBA Inbound Eligibilty
 * With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { Error } from './Error.js'
import { ItemEligibilityPreview } from './ItemEligibilityPreview.js'

/**
 * The GetItemEligibilityPreviewResponse model module.
 * @module fbaeligibility_v1/model/GetItemEligibilityPreviewResponse
 * @version v1
 */
export class GetItemEligibilityPreviewResponse {
  /**
   * Constructs a new <code>GetItemEligibilityPreviewResponse</code>.
   * The response schema for the getItemEligibilityPreview operation.
   * @alias module:fbaeligibility_v1/model/GetItemEligibilityPreviewResponse
   * @class
   */
  constructor () {
  }

  /**
   * Constructs a <code>GetItemEligibilityPreviewResponse</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {GetItemEligibilityPreviewResponse} obj Optional instance to populate.
   * @return {GetItemEligibilityPreviewResponse} The populated <code>GetItemEligibilityPreviewResponse</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new GetItemEligibilityPreviewResponse()
      if (data.hasOwnProperty('payload')) { obj.payload = ItemEligibilityPreview.constructFromObject(data.payload) }
      if (data.hasOwnProperty('errors')) { obj.errors = ApiClient.convertToType(data.errors, [Error]) }
    }
    return obj
  }
}

/**
 * @member {ItemEligibilityPreview} payload
 * @type {ItemEligibilityPreview}
 */
GetItemEligibilityPreviewResponse.prototype.payload = undefined

/**
 * A list of error responses returned when a request is unsuccessful.
 * @member {[Error]} errors
 * @type {[Error]}
 */
GetItemEligibilityPreviewResponse.prototype.errors = undefined
